import request from '@/utils/request'

const api_name = '/cmsservice/admin/banner';

export default {

  //分页查询banner列表
  pageList(current, limit) {
    return request({
      url: `${api_name}/pageBannerList/${current}/${limit}`,
      method: 'get'
    })
  },

  //新增banner
  addBanner(bannerForm) {
    return request({
      url: `${api_name}/saveBanner`,
      method: 'post',
      data: bannerForm
    })
  },

  //修改banner
  updateBanner(bannerForm) {
    return request({
      url: `${api_name}/updateById/${bannerForm.id}`,
      method: 'put',
      data: bannerForm
    })
  },

  //根据id查询
  getBannerById(id) {
    return request({
      url: `${api_name}/getBannerById/${id}`,
      method: 'get',
    })
  },

  //根据id删除
  deleteBannerById(id) {
    return request({
      url: `${api_name}/removeById/${id}`,
      method: 'delete',
    })
  },

}
